package com.zz.load.servlet;

import com.zz.load.exception.MyServletException;
import com.zz.load.http.MyRequestServlet;
import com.zz.load.http.MyResponseServlet;
import com.zz.load.util.MyPrintWriter;

import java.io.IOException;

public class CaleServlet extends MyHttpServlet {
    @Override
    protected void doPost(MyRequestServlet request, MyResponseServlet response) throws MyServletException, IOException {
        int num1 = Integer.parseInt(request.getParameter("num1"));
        int num2 = Integer.parseInt(request.getParameter("num2"));
        int num3 = num1 * num2;
        MyPrintWriter writer = response.getWriter();
        writer.write(num3);
    }

    @Override
    protected void doGet(MyRequestServlet request, MyResponseServlet response) throws MyServletException, IOException {
        doPost(request, response);
    }
}